package com.changestuffs.commons.chain;

import com.google.common.eventbus.EventBus;

public abstract class AbstractChain {

	protected AbstractChain nextChain;
	private EventBus eventBus;
	
	final void setNext(AbstractChain nextChain) {
		this.nextChain = nextChain;
	}
	
	final void setEventBus(EventBus eventBus){
		this.eventBus = eventBus;
	}
	
	public abstract void execute();
	
	protected <T> void post(T object){
		eventBus.post(object);
	}
	
}
